<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    显示的内容是：{{ message }}, $msg: {{ $data.$msg }}. {{ handleMessage() }}
    <br>
    <button v-on:click="handleClick">按钮</button>
    <ul>
      <li>1</li>
      <li>2</li>
      <li>3</li>
    </ul>
  </div>

  <script src="./libs/vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app', // v - view
      data: { // m - model
        message: 'hello',
        list: [1, 2, 3, 4, 5],
        $msg: '这是$msg内容'
      },
      methods: {
        handleClick() {
          console.log('点击了按钮', this === vm)
        },
        handleMessage() {
          return this.message.split('').reverse().join('')
        }
      }
    })
  </script>
</body>
</html>